home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume7 / uunet < prev    next >
Encoding:
Text File  |  1989-06-03  |  3.5 KB  |  127 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. Subject: v07i016: useful programs for accessing uunet
  4. Reply-To: seg@smsdpg.UUCP (Scott Garfinkle)
  5.  
  6. Posting-number: Volume 7, Issue 16
  7. Submitted-by: seg@smsdpg.UUCP (Scott Garfinkle)
  8. Archive-name: uunet
  9.  
  10. [Semi-automated UUCP retrieval of files from uunet's archives.  ++bsa]
  11.  
  12. I have no idea whether this stuff "deserves" further distribution, but
  13. I thought I'd send you a couple of csh script that make accessing uunet
  14. easier.  I hope that someone can use them.
  15.     yours, scott g.
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # The shar that generated this appeared in the comp.sources.unix newsgroup;
  22. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  23. # If this archive is complete, you will see the following message at the end:
  24. #        "End of archive 1 (of 1)."
  25. # Contents:  get_files squashls
  26. # Wrapped by seg@smsdpg on Wed May 31 09:44:24 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'get_files' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'get_files'\"
  30. else
  31. echo shar: Extracting \"'get_files'\" \(661 characters\)
  32. sed "s/^X//" >'get_files' <<'END_OF_FILE'
  33. X#!/bin/csh -f
  34. X# get_files - by Scott E. Garfinkle (seg@smsdpg.uu.net)
  35. X# create and execute uucp commands based on extract from uunet's ls-lR
  36. Xif($#argv == 1) then
  37. X    set fn=$1
  38. Xelse
  39. X    set fn=want
  40. Xendif
  41. Xset tfile=temp.$$
  42. Xset tfile2=temp2.$$
  43. Xcat > $tfile << 'XX'    # sed script
  44. X/^$/d
  45. X/:$/s// :/
  46. X/^d/d
  47. Xs/^-.*198[6789] //
  48. Xs/^-.*[0-5][0-9] //
  49. X'XX'
  50. Xcat > $tfile2 << 'XX'     # awk script
  51. X$0 ~ /.*:/ { prefix = $1 }
  52. X$0 !~ /.*:/ { printf "%s/%s\n", prefix, $0 }
  53. X'XX'
  54. Xsed -f $tfile < $fn | awk -f $tfile2 | \
  55. X    sed 's;/usr/spool/ftp\(.*\);uucp -d uunet\!\\~uucp\1 ~uucp\1;' | \
  56. X    (echo "Executing following commands:" > /dev/tty; tee /dev/tty) | \
  57. X    sh -s
  58. Xrm $tfile $tfile2
  59.  
  60. END_OF_FILE
  61. echo shar: NEWLINE appended to \"'get_files'\"
  62. if test 662 -ne `wc -c <'get_files'`; then
  63.     echo shar: \"'get_files'\" unpacked with wrong size!
  64. fi
  65. chmod +x 'get_files'
  66. # end of 'get_files'
  67. fi
  68. if test -f 'squashls' -a "${1}" != "-c" ; then 
  69.   echo shar: Will not clobber existing file \"'squashls'\"
  70. else
  71. echo shar: Extracting \"'squashls'\" \(476 characters\)
  72. sed "s/^X//" >'squashls' <<'END_OF_FILE'
  73. X#!/bin/csh -f
  74. X# squasls - by Scott E. Garfinkle (seg@smsdpg.uu.net)
  75. X# masssage ls-lR[.Z] files from uunet into a more manageable format.
  76. Xif(-e ls-lR.Z) uncompress ls-lR
  77. Xif(! -e ls-lR) then
  78. X    echo this program uncompresses and massages ls-lR.Z -- none present
  79. X    exit 1
  80. Xendif
  81. Xex - ls-lR <<'XX' >& /dev/null
  82. Xg/^$/d
  83. Xg/^d/d
  84. Xg/^total/d
  85. Xg/unreadable/d
  86. X1
  87. X/\/usr\/spool\/ftp\/faces/
  88. X/^\//ka
  89. X$
  90. X?\/faces\/?
  91. X/^\//kb
  92. X'a,'bw! faces.list
  93. X'a,'bd
  94. Xw
  95. Xq
  96. X'XX'
  97. Xrm -f faces.list.Z
  98. Xcompress faces.list
  99.  
  100. END_OF_FILE
  101. echo shar: NEWLINE appended to \"'squashls'\"
  102. if test 477 -ne `wc -c <'squashls'`; then
  103.     echo shar: \"'squashls'\" unpacked with wrong size!
  104. fi
  105. chmod +x 'squashls'
  106. # end of 'squashls'
  107. fi
  108. echo shar: End of archive 1 \(of 1\).
  109. cp /dev/null ark1isdone
  110. MISSING=""
  111. for I in 1 ; do
  112.     if test ! -f ark${I}isdone ; then
  113.     MISSING="${MISSING} ${I}"
  114.     fi
  115. done
  116. if test "${MISSING}" = "" ; then
  117.     echo You have the archive.
  118.     rm -f ark[1-9]isdone
  119. else
  120.     echo You still need to unpack the following archives:
  121.     echo "        " ${MISSING}
  122. fi
  123. ##  End of shell archive.
  124. exit 0
  125.  
  126.  
  127.